package com.lvmama.controller.dw.priceStock;

import java.util.List;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lvmama.client.dw.StockAndPriceSearchClient;
import com.lvmama.common.result.Result;
import com.lvmama.pojo.entity.dw.priceStock.StockAndPriceSearch;

/**
 * @Author:xuzhongwei
 * @Description:
 * @Date：2018/08/07
 */
@Controller
@RequestMapping("config")
@Slf4j
public class ConfigController {
	@Autowired
    private StockAndPriceSearchClient stockAndPriceSearchClient;
	
	/**
     * 获取品类列表
     * @return 品类列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectCategoryList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>> selectCategoryList(){
		log.info("selectCategoryList start");
		Result<List<StockAndPriceSearch>> result = Result.success(null) ;
		try {
			 result =  this.stockAndPriceSearchClient.selectCategoryList();
		}catch (Exception e){
			log.error(e.getMessage());
		}
		log.info("result: " + result.toString());
		log.info("selectCategoryList end");
		return result;
	}
	
    /**
     * 查询销售渠道列表
     * @return 销售渠道列表
     */
	
	@RequestMapping(method = RequestMethod.GET, value = "/selectChannelList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>> selectChannelList(){
		return this.stockAndPriceSearchClient.selectChannelList();
	}
    
    /**
     * 获取酒店列表
     * @return 酒店列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectProductList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>>  selectProductList(){
		return this.stockAndPriceSearchClient.selectProductList();
	}
    
    /**
     * 根据大区查询产品经理列表
     * @return 产品经理列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectProductManagerList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>>  selectProductManagerList(String regioname){
		return this.stockAndPriceSearchClient.selectProductManagerList(regioname);
	}
	
    /**
     * 查询大区列表
     * @return 大区列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectRegionList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>> selectRegionList(){
		return this.stockAndPriceSearchClient.selectRegionList();
	}
    
    /**
     * 查询供应商列表
     * @return 供应商列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectSupperNameList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>> selectSupperNameList(){
		return this.stockAndPriceSearchClient.selectSupperNameList();
	}
	
    /**
     * 查询供应商类型列表
     * @return 供应商类型列表
     */
	@RequestMapping(method = RequestMethod.GET, value = "/selectSupperTypeList")
	@ResponseBody
	public Result<List<StockAndPriceSearch>> selectSupperTypeList(){
		return this.stockAndPriceSearchClient.selectSupperTypeList();
	}

}
